package com.google.code.alpaca.prototype.server;

import net.customware.gwt.dispatch.server.guice.GuiceDispatch;
import net.customware.gwt.dispatch.server.guice.GuiceLazyActionHandlerRegistry;
import net.customware.gwt.dispatch.server.guice.ServerDispatchModule;

import com.google.inject.Guice;
import com.google.inject.Injector;
import com.google.inject.persist.jpa.JpaPersistModule;
import com.google.inject.servlet.GuiceServletContextListener;

/**
 * @author Robert Munteanu
 * 
 */
public class BootstrapListener extends GuiceServletContextListener {

	@Override
	protected Injector getInjector() {

		Injector inj = Guice.createInjector(new ServerDispatchModule(
				GuiceDispatch.class, GuiceLazyActionHandlerRegistry.class),
				new JpaPersistModule("transactions-optional"),
				new ActionHandlerConfigModule(), new DispatchServletModure(),
				new DAOConfigModule());
		return inj;
	}

}
